<?php

if (!defined('BASEPATH'))
    exit('No direct script access allowed');

class Article extends CI_Controller {

    /**
     * Index action 
     * @author tien.nguyen
     */
    public function index($cate, $page = 1) {
 //       $CI = & get_instance();
//        echo '<pre>'; print_r($CI->router->uri->segments); die;
        
        //instance model
        $this->load->model('News', '', true);     

        //load data by model 
        $data['News'] = $this->News->getListNews($cate, $page);
        $data['CateCode'] = $cate;
        $this->load->view('article/index', $data);
    }
    
    public function detail($newId){
        $this->load->model('News', '', true);
        
        //load new detail
        //load data by model 
        $data['News'] = $this->News->getNews($newId);
        $this->load->view('article/detail', $data);
    }

}